package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv2Mapper;
import com.ruoyi.net.domain.ElementOspfv2;
import com.ruoyi.net.service.IElementOspfv2Service;

/**
 * 网元-OSPFV2进程配置-Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv2ServiceImpl implements IElementOspfv2Service 
{
    @Autowired
    private ElementOspfv2Mapper elementOspfv2Mapper;

    /**
     * 查询网元-OSPFV2进程配置-
     * 
     * @param id 网元-OSPFV2进程配置-主键
     * @return 网元-OSPFV2进程配置-
     */
    @Override
    public ElementOspfv2 selectElementOspfv2ById(String id)
    {
        return elementOspfv2Mapper.selectElementOspfv2ById(id);
    }

    /**
     * 查询网元-OSPFV2进程配置-列表
     * 
     * @param elementOspfv2 网元-OSPFV2进程配置-
     * @return 网元-OSPFV2进程配置-
     */
    @Override
    public List<ElementOspfv2> selectElementOspfv2List(ElementOspfv2 elementOspfv2)
    {
        return elementOspfv2Mapper.selectElementOspfv2List(elementOspfv2);
    }

    /**
     * 新增网元-OSPFV2进程配置-
     * 
     * @param elementOspfv2 网元-OSPFV2进程配置-
     * @return 结果
     */
    @Override
    public int insertElementOspfv2(ElementOspfv2 elementOspfv2)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv2.getId())) {
            elementOspfv2.setId(uuid);
        }
        elementOspfv2.setCreateBy(SecurityUtils.getUsername());
        elementOspfv2.setCreateTime(DateUtils.getNowDate());
        elementOspfv2.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2Mapper.insertElementOspfv2(elementOspfv2);
    }

    /**
     * 修改网元-OSPFV2进程配置-
     * 
     * @param elementOspfv2 网元-OSPFV2进程配置-
     * @return 结果
     */
    @Override
    public int updateElementOspfv2(ElementOspfv2 elementOspfv2)
    {
        elementOspfv2.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2Mapper.updateElementOspfv2(elementOspfv2);
    }

    /**
     * 批量删除网元-OSPFV2进程配置-
     * 
     * @param ids 需要删除的网元-OSPFV2进程配置-主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2ByIds(String[] ids)
    {
        return elementOspfv2Mapper.deleteElementOspfv2ByIds(ids);
    }

    /**
     * 删除网元-OSPFV2进程配置-信息
     * 
     * @param id 网元-OSPFV2进程配置-主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2ById(String id)
    {
        return elementOspfv2Mapper.deleteElementOspfv2ById(id);
    }
}
